<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html>
<html lang="en">
	<head>
	<base href="<%=basePath%>">
	<meta charset="utf-8" />
	<title></title>
	<meta name="description" content="overview & stats" />
	<meta name="viewport" content="width=device-width, initial-scale=1.0" />
	<link rel="stylesheet" href="static/css/bootstrap.min.css" />
	<link rel="stylesheet" href="static/css/bootstrap-responsive.min.css" />
	<link rel="stylesheet" href="static/css/font-awesome.min.css" />
	<!-- 下拉框 -->
	<link rel="stylesheet" href="static/css/chosen.css" />
	<link rel="stylesheet" href="static/css/ace.min.css" />
	<link rel="stylesheet" href="static/css/ace-responsive.min.css" />
	<link rel="stylesheet" href="static/css/ace-skins.min.css" />
	<style type="text/css">
	input, textarea, .uneditable-input {
	    width: 306px;
	}
	</style>
	<script type="text/javascript" src="static/1.9.1/jquery.min.js"></script>
	<!--提示框-->
	<script type="text/javascript" src="static/js/jquery.tips.js"></script>
		
	<script type="text/javascript">
	$(top.hangge());
	
	//保存
	function save(){
		if($("#tableno").val()==""){
			$("#tableno").tips({
				side:3,
	            msg:'输入桌台编号',
	            bg:'#AE81FF',
	            time:2
	        });
			$("#tableno").focus();
			$("#tableno").val('');
			$("#tableno").css("background-color","white");
			return false;
		}
		
		if($("#tablename").val()==""){
			$("#tablename").tips({
				side:3,
	            msg:'输入桌台名称',
	            bg:'#AE81FF',
	            time:3
	        });
			$("#tablename").focus();
			return false;
		}
		
		if($("#coordinatex").val()=="" || $("#coordinatex").val()== null){
			$("#coordinatex").tips({
				side:3,
	            msg:'输入X坐标',
	            bg:'#AE81FF',
	            time:3
	        });
			$("#coordinatex").focus();
			return false;
		}else{
			var coordinatex = $("#coordinatex").val();
			
			if(isNaN(coordinatex)){
				$("#coordinatex").tips({
					side:3,
		            msg:'X坐标必须是数值',
		            bg:'#AE81FF',
		            time:3
		        });
				$("#coordinatex").focus();
				return false;
			}
		}
		
		if($("#coordinatey").val()=="" || $("#coordinatey").val()== null){
			$("#coordinatey").tips({
				side:3,
	            msg:'输入Y坐标',
	            bg:'#AE81FF',
	            time:3
	        });
			$("#coordinatey").focus();
			return false;
		}else{
			var coordinatey = $("#coordinatey").val();
			
			if(isNaN(coordinatey)){
				$("#coordinatey").tips({
					side:3,
		            msg:'Y坐标必须是数值',
		            bg:'#AE81FF',
		            time:3
		        });
				$("#coordinatey").focus();
				return false;
			}
		}
		$("#commercialTableForm").submit();
		$("#centerOfMainFrame").hide();
		$("#centerOfMainFrame2").show();
		
	}
	</script>
	</head>
<body>
	<form action="<%=basePath%>/commercial/table/saveTable.do" name="commercialTableForm" id="commercialTableForm" method="post">
		<input type="hidden" name="organid" id="organid" value="${pageData.organid }"/>
		<input type="hidden" name="layer" id="layer" value="${pageData.layer }"/>
		<div id="centerOfMainFrame">
			<table>
				<tr>
					<td>桌台编号：<input type="text" name="tableno" id="tableno" maxlength="32" placeholder="这里输入桌台编号" title="桌台编号" style="width:300px; font-size:12px;"/></td>
				</tr>
				<tr>
					<td>桌台名称：<input type="text" name="tablename" id="tablename"  maxlength="32" placeholder="这里输入桌台名称" title="桌台名称" style="width:300px; font-size:12px;"/></td>
				</tr>
				<tr>
					<td>坐标X：<input type="text" name="coordinatex" id="coordinatex"  maxlength="32" placeholder="这里输入坐标X" title="坐标X" style="width:300px; font-size:12px; margin-left: 16px;"/></td>
				</tr>
				<tr>
					<td>坐标Y：<input type="text" name="coordinatey" id="coordinatey"  maxlength="32" placeholder="这里输入坐标Y" title="坐标Y" style="width:300px; font-size:12px; margin-left: 16px;"/></td>
				</tr>
				<tr>
					<td>经度：<input type="text" name="longitude" id="longitude"  maxlength="32" placeholder="这里输入经度" title="经度" style="width:300px; font-size:12px; margin-left: 24px;"/></td>
				</tr>
				<tr>
					<td>纬度：<input type="text" name="latitude" id="latitude"  maxlength="32" placeholder="这里输入纬度" title="纬度" style="width:300px; font-size:12px; margin-left: 24px;"/></td>
				</tr>			
				<tr>
					<td>状态：
						<select name="status" title="状态" style="width:100px; font-size:12px; margin-left: 6%;">
							<option value="1">已预定</option>
							<option value="0" selected>未预定</option>
						</select>
					</td>
				</tr>
				<tr>
					<td>桌台备注：<textarea name="remark" id="remark" placeholder="这里输入备注" title="备注" style="font-size:12px; width: 300px; height: 225px;"></textarea></td>
				</tr>
				<tr>
					<td style="text-align: center;">
						<a class="btn btn-mini btn-primary" onclick="save();">保存</a>
						<a class="btn btn-mini btn-danger" onclick="top.Dialog.close();">取消</a>
					</td>
				</tr>
			</table>
		</div>
		<div id="centerOfMainFrame2" class="center" style="display:none"><br/><br/><br/><br/><img src="static/images/jiazai.gif" /><br/><h4 class="lighter block green"></h4></div>
	</form>
	
	<!-- 引入 -->
	<script type="text/javascript">window.jQuery || document.write("<script src='static/js/jquery-1.9.1.min.js'>\x3C/script>");</script>
	<script type="text/javascript" src="static/js/bootstrap.min.js"></script>
	<script type="text/javascript" src="static/js/ace-elements.min.js"></script>
	<script type="text/javascript" src="static/js/ace.min.js"></script>
	<script type="text/javascript" src="static/js/chosen.jquery.min.js"></script><!-- 下拉框 -->
</body>
</html>